package com.hangzhou.xyj.net.response.base;

/**
 * Created by dfb on 2015/12/20.
 * 服务器返回数据基类
 */
public class BaseResponse<T> {


//    {
//        "result": "0000",
//            "msg": "success",
//            "data": {
//    }
//    }
//    result -- 0000:表示成功,其他不成功
//    msg：成功表示success，其他为错误信息
//    obj：返回具体内容

    private static final String SUCCESS = "0000";

    private String result;
    private String msg;
    private T data;

    public String getMsg() {
        return msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public boolean isSuccess() {
        return SUCCESS.equals(result);
    }

    @Override
    public String toString() {
        return "BaseResponse{" +
                "result='" + result + '\'' +
                ", msg='" + msg + '\'' +
                ", data=" + data +
                '}';
    }
}
